# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Testing.V1.Model.ShardingOption do
  @moduledoc """
  Options for enabling sharding.

  ## Attributes

  *   `manualSharding` (*type:* `GoogleApi.Testing.V1.Model.ManualSharding.t`, *default:* `nil`) - Shards test cases into the specified groups of packages, classes, and/or methods.
  *   `smartSharding` (*type:* `GoogleApi.Testing.V1.Model.SmartSharding.t`, *default:* `nil`) - Shards test based on previous test case timing records.
  *   `uniformSharding` (*type:* `GoogleApi.Testing.V1.Model.UniformSharding.t`, *default:* `nil`) - Uniformly shards test cases given a total number of shards.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :manualSharding => GoogleApi.Testing.V1.Model.ManualSharding.t() | nil,
          :smartSharding => GoogleApi.Testing.V1.Model.SmartSharding.t() | nil,
          :uniformSharding => GoogleApi.Testing.V1.Model.UniformSharding.t() | nil
        }

  field(:manualSharding, as: GoogleApi.Testing.V1.Model.ManualSharding)
  field(:smartSharding, as: GoogleApi.Testing.V1.Model.SmartSharding)
  field(:uniformSharding, as: GoogleApi.Testing.V1.Model.UniformSharding)
end

defimpl Poison.Decoder, for: GoogleApi.Testing.V1.Model.ShardingOption do
  def decode(value, options) do
    GoogleApi.Testing.V1.Model.ShardingOption.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Testing.V1.Model.ShardingOption do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
